import { Injectable } from '@angular/core';
import { _HttpClient } from '@delon/theme';
import { Observable } from 'rxjs';

@Injectable({
  providedIn: 'root'
})
export class CatalogService {

  constructor(private http: _HttpClient) { }

  // 查询分类列表
  queryCatalogList(parentId: any): Observable<any> {
    const url = "/category/list?pageStart=1&pageSize=10";
    return this.http.get(url); 
  }

  createOrEdit(data: any): Observable<any> {
    const url = "/category/save";
    return this.http.post(url, data); 
  }

  del(id: any): Observable<any> {
    const url = "/category/del/" + id;
    return this.http.post(url); 
  }
}
